]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
modalDialog: show dialogs on monitor with the mouse pointer
authorTim L <tim@feathertop.org>
Fri, 8 Jun 2012 08:26:58 +0000 (18:26 +1000)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sat, 9 Jun 2012 03:05:56 +0000 (23:05 -0400)
Show the dialog on the monitor containing the pointer, rather than
the monitor with active focused window. This brings it inline with
the behaviour seen when launching applications.

Remove the focusMonitor/focusIndex from LayoutManager. These
properties were only used by the modal dialogs. Remove them since
they are not being used elsewhere.

https://bugzilla.gnome.org/show_bug.cgi?id=642591

js/ui/layout.js
js/ui/modalDialog.js

index 6351ad9eb88a32c22a241bd68df213f86212a1f0..ef1a1b2bdaca7c696e03ccecae64bcfc251b232b 100644 (file)
@@ -228,26 +228,9 @@ const LayoutManager = new Lang.Class({
         return false;
     },
 
-    get focusIndex() {
-        let focusWindow = global.display.focus_window;
-
-        if (focusWindow) {
-            let wrect = focusWindow.get_outer_rect();
-            for (let i = 0; i < this.monitors.length; i++) {
-                let monitor = this.monitors[i];
-
-                if (monitor.x <= wrect.x && monitor.y <= wrect.y &&
-                    monitor.x + monitor.width > wrect.x &&
-                    monitor.y + monitor.height > wrect.y)
-                    return i;
-            }
-        }
-
-        return this.primaryIndex;
-    },
-
-    get focusMonitor() {
-        return this.monitors[this.focusIndex];
+    get currentMonitor() {
+        let index = global.screen.get_current_monitor();
+        return Main.layoutManager.monitors[index];
     },
 
     _startupAnimation: function() {
index 6109b32938671655bf1b81355a02aea1b53c562c..e30b7059684b55d689a2b3543f246d722dace90d 100644 (file)
@@ -180,7 +180,7 @@ const ModalDialog = new Lang.Class({
     },
 
     _fadeOpen: function() {
-        let monitor = Main.layoutManager.focusMonitor;
+        let monitor = Main.layoutManager.currentMonitor;
 
         this._backgroundBin.set_position(monitor.x, monitor.y);
         this._backgroundBin.set_size(monitor.width, monitor.height);